package demo.day07;

import java.util.Scanner;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/7/25-07-25-19:01
 * @Description：demo.day07  斐波那契数列
 */
public class Fibonacci_Sequence {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int result = matipuly(n);
        System.out.println(n + "的阶层结果为：" + result);
        fibonacci_damo(n);

    }

    public static int matipuly(int n) {
        if(n == 1){
            return 1;
        }else if(n == 2){
            return 2;
        }
        return n * matipuly(n-1);
    }

    public static int fibonacci_damo(int n) {
        if(n == 1){
            return 1;
        }else if(n == 2){
            return 1;
        }
        return fibonacci_damo(n-1) + fibonacci_damo(n-2);
    }
}
